package com.companyname.domain;

public class Hanoi {
	
	
	public static void move(int n , String full ,String empty , String target){
		if(n == 1){
			printAction(full,target,1);
			return;
		}
		
		//把n-1 从满的移到空的
		//把满的最后一个移到目标区
		//把原本空的 现在装有n-1的 移到目标区
		move( n-1,full,target,empty);
		printAction(full,target,n);
		
		move(n-1,empty,full,target);
	}
	
	public static void printAction(String source,String target,int number){
		System.out.printf("move %s : %d to %s\n", source ,number, target);
	}
}
